Conversation
|
👋 Welcome back epeter! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
|
@eme64 this pull request can not be integrated into git checkout JDK-8386591-char-truncation-broken
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
@eme64 This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply issue a |
The third bug covered by #31501.
As we have seen in #31395, the
CountedLoopConverter::has_truncation_wrapalgorithm had some peculiarities, specifically this one:So here we are. The issue is that we recognized
0x7fffaschar truncation, and accordingly only check that we cannot overflow/wrap the rangeCHAR = [0 .. 0xffff], so if we got a value in range0x8000 .. 0xffff, that ends up overflowing/wrapping, but since we only checked for overflow outside theCHARrange, we wrongly decide there is no wrap/overflow.Fix for 0x7fff:
I now allow both masks
0x7fffand0xffff, for ranges0..0x7fffand0..0xffffrespectively. I have no idea why we ever had0x7fffin the first place, because0xffffis what's used forcharcast, and I don't know of any Java language truncation that would produce the 15-bit unsigned truncation of0x7fff. But still: we used to optimize it, and so I'm keeping it to avoid regressions.Also addressing signed 8-bit truncation
I also decided to address an issue in the signed truncation at the same time. I suppose I could split that out into an RFE, but it also seems like a similar oversight, also mentioned in #31395:
So I slightly fixed/refactored that part too.
Testing
0x7fffwrap issue.TestHasTruncationWrap.java.This bug was found by the fuzzer from #31501, which I will integrate soon after this issue is fixed, and then we'll have even better coverage going forward.
Progress
Issue
Backport <hash>with the hash of the original commit. See Backports.Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31502/head:pull/31502$ git checkout pull/31502Update a local copy of the PR:
$ git checkout pull/31502$ git pull https://git.openjdk.org/jdk.git pull/31502/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31502View PR using the GUI difftool:
$ git pr show -t 31502Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31502.diff